﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace TestDataFileManipulator
{
    public partial class MultipleColumnSeparatorUserControl : UserControl
    {
        public MultipleColumnSeparatorUserControl()
        {
            InitializeComponent();
        }

        public string[] GetSeparators()
        {
            List<string> separators = new List<string>();

            if (this.checkBoxTab.Checked == true)
                separators.Add("\t");
            if (this.checkBoxComma.Checked == true)
                separators.Add(",");
            if (this.checkBoxSemecolon.Checked == true)
                separators.Add(";");
            if (this.checkBoxSpace.Checked == true)
                separators.Add(" ");
            if (this.checkBoxOther.Checked == true)
            {
                string sep = this.textBoxOther.Text;
                if (string.IsNullOrEmpty(sep) == false)
                    separators.Add(sep);
            }

            if (separators.Count == 0)
                return null;

            return separators.ToArray();
        }

    }
}
